/////////////////////////////////////////////////////////////////////////////
// Name:        blurtapp.h
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     18/02/2009 19:13:38
// RCS-ID:      
// Copyright:   
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _BLURTAPP_H_
#define _BLURTAPP_H_

/*!
 * Includes
 */

////@begin includes
#include "wx/image.h"
#include "mainframe.h"
////@end includes

#include "tts/tts.h"
#include "tts/tts_batchencoder.h"
#include "tts/tts_speechsettingspanel.h"
#include "tts/mp3encoder.h"

/*!
 * Forward declarations
 */

////@begin forward declarations
////@end forward declarations

/*!
 * Control identifiers
 */

////@begin control identifiers
////@end control identifiers

/*!
 * BlurtApp class declaration
 */

class BlurtApp: public wxApp
{    
    DECLARE_CLASS( BlurtApp )
    DECLARE_EVENT_TABLE()

public:
    /// Constructor
    BlurtApp();

    void Init();

    /// Initialises the application
    virtual bool OnInit();

    /// Called on exit
    virtual int OnExit();

    /// Initialize transformer
    void InitializeTransformer();

    /// Save eSpeak pronunciation table
    void SaveTransformer();

    /// Add temporary file to be deleted later
    void AddTemporaryFile(const wxString& filename) { m_tempFilenames.Add(filename); }

    /// Delete temporary files
    void DeleteTemporaryFiles();

    /// Get speech settings info
    wxTTSSpeechSettingsInfo& GetSpeechSettingsInfo() { return m_speechSettingsInfo; }
    
    /// Get MP3 settings info
    wxMP3EncoderInfo& GetMP3SettingsInfo() { return m_mp3SettingsInfo; }

    /// Get speech object
    wxTextToSpeech& GetSpeech() { return m_speech; }

    /// Get MP3 encoder object
    wxBatchTextToMP3Encoder& GetBatchEncoder() { return m_batchEncoder; }
    
    /// Get pronunciation table
    wxTTSTransformer& GetTransformer() { return m_transformer; }

    /// Load settings
    bool LoadSettings();
    
    /// Save settings
    bool SaveSettings();
    
////@begin BlurtApp event handler declarations

////@end BlurtApp event handler declarations

////@begin BlurtApp member function declarations

////@end BlurtApp member function declarations

////@begin BlurtApp member variables
////@end BlurtApp member variables

    wxTextToSpeech              m_speech;
    wxBatchTextToMP3Encoder     m_batchEncoder;
    wxTTSTransformer            m_transformer;
    wxTTSSpeechSettingsInfo     m_speechSettingsInfo;
    wxMP3EncoderInfo            m_mp3SettingsInfo;
    
    /// Temorary files to be deleted on exit
    wxArrayString               m_tempFilenames;
};

/*!
 * Application instance declaration 
 */

////@begin declare app
DECLARE_APP(BlurtApp)
////@end declare app

#endif
    // _BLURTAPP_H_
